//
//  VihomeLinkage.h
//  Vihome
//
//  Created by Ned on 1/16/15.
//  Copyright © 2017年 orvibo. All rights reserved.
//

#import "HMBaseModel+Extension.h"

@interface HMLinkage : HMBaseModel

/**
 *  主键、自增长
 */
@property (nonatomic, retain)NSString *          linkageId;

/**
 *  联动名称，1-16字节
 */
@property (nonatomic, retain)NSString *         linkageName;

/**
 *  0：表示开启联动，如果触发条件满足的话则输出联动动作
 *  1：表示暂停联动，不管如何都不输出联动动作
 */
@property (nonatomic, assign)int                isPause;

// and：表示条件进行“与”运算  or：表示条件进行“或”运算
@property (nonatomic, copy)NSString  *              conditionRelation;



+ (NSArray *)allLinkagesArr;

+ (HMLinkage *)objectWithLinkageId:(NSString *)linkageId;

/**
 *  根据联动输出设备删除相关联动
 */
+ (void)deleteLinkageWithDeviceId:(NSString *)deviceId;

+ (void)deleteLinkageWithLinkageId:(NSString *)linkageId;

+ (void)deleteSecurityWithDeviceId:(NSString *)deviceId;

+ (NSInteger)getLinageConditionCountWithLinakgeId:(NSString *)linkageId;

+ (BOOL)isAlloneLinkage:(NSString *)linkageId;

@end
